
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="css/styless.css">
</head>
<body style="background-image: url('/images/00000-1105631198.png');">
<form action="<%=pageContext.getServletContext().getContextPath()%>/loginServlet">
    <table width="100%" height="100%" >
        <tr>
            <td align="center">
                <p><input type="hidden" name="Type" id="Type">
                用户名：<input type="text" name="username" id="username" >&nbsp;
            </p>
                <p>密码：<input type="password" name="password" id="password"></p>
                <input type="button" value="登录" onclick="login()">
                <input type="button" value="注册" onclick="window.location.href='<%=pageContext.getServletContext().getContextPath()%>/register.jsp'">
                <input type="button" value="管理员登录" onclick="Login2()">
            </td>
        </tr>
    </table>
</form>
<script type="text/javascript">
    function login() {
        document.getElementById("Type").value="user";
        document.forms[0].action="loginServlet";
        document.forms[0].submit();
    }
    function Login2()
    {
        document.getElementById("Type").value="admin";
        document.forms[0].action="loginServlet";
        document.forms[0].submit();
    }
</script>
</body>
</html>
